/***********************************************************************************************************************
 *                                                      ESourceOpen
 *                                           -----------------------------------
 *                                           explore and open  embedded platform
 * 
 * Contact information:
 * e-mail: 1786409879@qq.com / txh17778443952@169.com
 *                                                                                 +-------------+---------------------+
 * ESourceOpen：                                                                   |   founder   |       TXHopen       |
 *   The ESource plan is a difficult and long-term plan. This plan                 +-------------+---------------------+
 *   does not limit the use of code, only to provide an open platform              |   encode    |    UTF-8 / utf-8    |
 *   to explore the software development of embedded platforms.                    +-------------+---------------------+
***********************************************************************************************************************/
/**
 * *****************************************************ESourceOPEN*****************************************************
 * @file      DigitalTube6.c
 * 
 * @brief     片外驱动：6位数码管驱动源码
 * 
 * @version   V0.00.01
 * 
 * @author    TXHopen (3332695529@qq.com)
 * 
 * @date      2021-08-08
 * 
 * @copyright Copyright (c) 2021
 * 
 * *****************************************************ESourceOPEN*****************************************************
 * 
 * *****************************************************ESourceOPEN*****************************************************
 **/
#include "DigitalTube6.h"

#ifdef DIGITALTUBE6_CONFIG

/* ------------------------------------------------------------------------------------------------------------------ */
static uchar SMG_Wei[6]   =
{
	0xe8,0xe9,0xea,0xeb,0xec,0xed
};

static uchar SMG_Duan[16] =
{
	0xc0,0xf9,0xa4,0xb0,
	0x99,0x92,0x82,0xf8,
	0x80,0x90,0x88,0x83,
	0xc6,0xa1,0x86,0x8e
};



/* ------------------------------------------------------------------------------------------------------------------ */
static void SMG_Delay(uchar ms)
{
	uchar i;
	while(ms--)
		for(i=0;i<110;i++);
}

/* ------------------------------------------------------------------------------------------------------------------ */
void SMG_Show(uchar x,uchar dat)
{
	SMG_WEI  = SMG_Wei[x];
	SMG_DUAN = SMG_Duan[dat];
	SMG_Delay(2);
}
/* ------------------------------------------------------------------------------------------------------------------ */
#endif /* DIGITALTUBE6_CONFIG */
